#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

int main(void){
int fd;
char wr[]= "a";

//fd = open("./test3.txt",O_RDWR);
 fd = open("./tes", O_WRONLY | O_CREAT | O_EXCL,
 S_IRWXU | S_IRGRP | S_IROTH);
if(-1 == fd){
    printf("文件已存在\n");
}
else printf("文件创建成功，你真厉害!\n");
for(int i=0;i<3000;i++){
    write(fd,wr,sizeof(wr));
}   
return 0;
}